import { createRouter, createWebHistory, RouteRecordRaw } from "vue-router";
import Longin from "../views/Longin.vue";


const routes: Array<RouteRecordRaw> = [


  {
    path: '/',
    name: 'Longin',
    component: Longin
  },
  
  {
    path: '/index',
    name: 'Index',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/index.vue'),
    children:[
      {
        path: '/manager',
        name: 'Manager',
        //按需加载路由组件
        component: () => 
        import(/* webpackChunkName: "manager" */ '../views/manager.vue')
      },
      {
        path: '/listgoods',
        name: 'Goods',
        //按需加载路由组件
        component: () => 
        import(/* webpackChunkName: "goods" */ '../views/Listgoods.vue')
       
      },
      {
        path: '/goodsadd',
        name: 'goodsadd',
        //按需加载路由组件
        component: () => 
        import(/* webpackChunkName: "goods" */ '../views/goodsadd.vue')
      },
      {
        path: '/listgoodscate',
        name: 'Listgoodscate',
        //按需加载路由组件
        component: () => 
        import(/* webpackChunkName: "goods" */ '../views/listgoodscate.vue')
      },
      {
        path: '/listgoodsattr',
        name: 'listgoodsattr',
        //按需加载路由组件
        component: () => 
        import(/* webpackChunkName: "goods" */ '../views/listgoodsattr.vue')
      },
      {
        path: '/listswiper',
        name: 'listswiper',
        //按需加载路由组件
        component: () => 
        import(/* webpackChunkName: "goods" */ '../views/listswiper.vue')
      },
      {
        path: '/listrole',
        name: 'listrole',
        //按需加载路由组件
        component: () => 
        import(/* webpackChunkName: "goods" */ '../views/role.vue')
      },
      {
        path: '/listmenu',
        name: 'listmenu',
        //按需加载路由组件
        component: () => 
        import(/* webpackChunkName: "goods" */ '../views/roleListmenu.vue')
      },
      {
        path: '/listorder',
        name: 'listorder',
        //按需加载路由组件
        component: () => 
        import(/* webpackChunkName: "goods" */ '../views/listorder.vue')
      }
      ,
      {
        path: '/client',
        name: 'client',
        //按需加载路由组件
        component: () => 
        import(/* webpackChunkName: "goods" */ '../views/client.vue')
      }
      
    ]
  }
  

];

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes,
});

export default router;
